DIGI POT 10 Click
DIGI POT 10 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Stefan Filipovic
- Date : Sep 2025.
- Type : I2C/SPI type
Software Support
Example Description
This example demonstrates the use of the DIGI POT 10 Click board. The application gradually changes the wiper positions of both potentiometers in opposite directions and logs their values.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.DIGIPOT10
Example Key Functions
- digipot10_cfg_setup This function initializes Click configuration structure to initial values.
void digipot10_cfg_setup(digipot10_cfg_t *cfg)
DIGI POT 10 configuration object setup function.
DIGI POT 10 Click configuration object.
Definition digipot10.h:265
- digipot10_init This function initializes all necessary pins and peripherals used for this Click board.
struct digipot10_s digipot10_t
DIGI POT 10 Click context object.
err_t digipot10_init(digipot10_t *ctx, digipot10_cfg_t *cfg)
DIGI POT 10 initialization function.
- digipot10_default_cfg This function executes a default configuration of DIGI POT 10 Click board.
err_t digipot10_default_cfg(digipot10_t *ctx)
DIGI POT 10 default configuration function.
- digipot10_set_wiper_0 This function sets the value of wiper 0 volatile register.
err_t digipot10_set_wiper_0(digipot10_t *ctx, uint16_t wiper)
DIGI POT 10 set wiper 0 function.
- digipot10_set_wiper_1 This function sets the value of wiper 1 volatile register.
err_t digipot10_set_wiper_1(digipot10_t *ctx, uint16_t wiper)
DIGI POT 10 set wiper 1 function.
Application Init
Initializes the driver, checks communication, and applies the default configuration.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
@ DIGIPOT10_ERROR
Definition digipot10.h:291
#define DIGIPOT10_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition digipot10.h:213
void application_init(void)
Definition main.c:30
Application Task
Alternately increments and decrements the wiper positions of both channels, while logging their values every second.
{
static int16_t wiper_step = 33;
{
log_printf( &logger, " Wiper 0 position: %u\r\n", wiper_pos );
}
{
}
wiper_pos += wiper_step;
{
wiper_step = -wiper_step;
wiper_pos += wiper_step;
wiper_pos += wiper_step;
}
Delay_ms ( 1000 );
}
@ DIGIPOT10_OK
Definition digipot10.h:290
#define DIGIPOT10_WIPER_ZERO_SCALE
Definition digipot10.h:174
#define DIGIPOT10_WIPER_FULL_SCALE
DIGI POT 10 wiper setting.
Definition digipot10.h:172
void application_task(void)
Definition main.c:67
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.